<?php
//---------------------------------------------------------
//---------------------------------------------------------


class MD5SignUtil {
	
	function sign($content, $key) {
	    if (null == $key || null == $content) {
		   Log::write("财付通签名key或者内容为空！");
		   return;
	    }
		
	    $signStr = $content . "&key=" . $key;
	
	    return strtoupper(md5($signStr));
	}
	
	function verifySignature($content, $sign, $md5Key) {
		$signStr = $content . "&key=" . $md5Key;
		$calculateSign = strtolower(md5($signStr));
		$tenpaySign = strtolower($sign);
		return $calculateSign == $tenpaySign;
	}
	
}


?>